<template>
  <section>
     
    <!-- 面包屑 -->
     <breadcrumbs></breadcrumbs>
    <div>
      <p>发送类型:
        <span v-if="detailData.createType==1">消息</span>
        <span v-if="detailData.createType==2">公告</span>
      </p>
      <p>发送人:{{sendName}}</p>
      <p v-if="detailData.cname!=undefined">发送主体:
        {{detailData.cname}}
      </p>
      <p v-if="detailData.rname!=undefined">接收主体:
        {{detailData.rname}}
      </p>
      <p>接收类型:
        <span v-if="detailData.recType==0">全部</span>
        <span v-if="detailData.recType==1">钉钉用户</span>
      </p>
      <p>消息标题:{{detailData.title}}</p>
      <div class="message-box">
        <p>消息详情:</p>
        <div v-html="detailData.content"></div>
      </div>
      <p>发送时间:{{detailData.createTime}}</p>
    </div>
  </section>
</template>

<script>
import breadcrumbs from "@/components/breadcrumbs.vue";
export default {
  name: "houseDetail",
  components: {

    breadcrumbs,
  },
  data() {
    return {
      messageId: "",
      detailData: {},
      sendName: ''
    }
  },
  created() {
    // console.log(this.$route.query.id)
    this.messageId = this.$route.query.messageId;
    this.houseData(this.messageId);
  },
  methods: {
    houseData(mid) {
      console.log(mid)
      this.$api.user.getSendMessageDetail({
        messageId: mid
      }).then(res => {
        if (res.code == 200) {
          this.detailData = res.data.ifno;
          this.sendName = res.data.sendName
          console.log(this.detailData, 12313123)
        }
      })
    },
  }
}
</script>

<style scoped>
.message-box {
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
</style>